var api = require('../../utils/api.js')


Page({

  /**
   * 页面的初始数据
   */
  data: {
    pmobile:'',
    name:'',
    mobile:''
  },

  
  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {

  },

  submits(){
    var that=this;

    var pmobile=this.data.pmobile;
    var name=this.data.name;
    var mobile=this.data.mobile;

    api.post({
      url: 'wxapp/user/renzhen',
      data: {pmobile:pmobile,name:name,mobile:mobile},
      success: data => {
         console.log(data);

         wx.showToast({
           title: data.msg,
           icon:'none'
         })

         if(data.code==1){
          setTimeout(function(){
            wx.switchTab({
              url: '/pages/index/index',
            })
         },1500)
         }

      }

  });

  },

  getname(ret){
    this.setData({
      name:ret.detail.value
    })
  },
  getmobile(ret){
    this.setData({
      mobile:ret.detail.value
    })
  },
  getpmobile(ret){
    this.setData({
      pmobile:ret.detail.value
    })
  }
})